From 773aa14ec3b2eabd69d0b135027ddeed918c2e15 Mon Sep 17 00:00:00 2001 From: "awilliam@xenbuild.aw" Date: Wed, 9 Aug 2006 10:04:43 -0600 Subject: [PATCH] [IA64] catch up new hypercall HYPERVISR_hvm_op for IPF (libxc) append xc_set_hvm_param for IPF Signed-off-by: Tsunehisa Doi Signed-off-by: Tomonari Horikoshi --- tools/libxc/ia64/xc_ia64_hvm_build.c | 30 ++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/tools/libxc/ia64/xc_ia64_hvm_build.c b/tools/libxc/ia64/xc_ia64_hvm_build.c index cc42f4888c..ededfe6e5d 100644 --- a/tools/libxc/ia64/xc_ia64_hvm_build.c +++ b/tools/libxc/ia64/xc_ia64_hvm_build.c @@ -6,6 +6,7 @@ #include #include "xen/arch-ia64.h" #include +#include static int xc_ia64_copy_to_domain_pages(int xc_handle, uint32_t domid, void* src_page, @@ -40,6 +41,31 @@ error_out: return -1; } +static void +xc_set_hvm_param(int handle, domid_t dom, int param, unsigned long value) +{ + DECLARE_HYPERCALL; + xen_hvm_param_t arg; + int rc; + + hypercall.op = __HYPERVISOR_hvm_op; + hypercall.arg[0] = HVMOP_set_param; + hypercall.arg[1] = (unsigned long)&arg; + + arg.domid = dom; + arg.index = param; + arg.value = value; + + if (mlock(&arg, sizeof(arg)) != 0) { + PERROR("Could not lock memory for set parameter"); + return; + } + + rc = do_xen_hypercall(handle, &hypercall); + safe_munlock(&arg, sizeof(arg)); + if (rc < 0) + PERROR("set HVM parameter failed (%d)", rc); +} #define HOB_SIGNATURE 0x3436474953424f48 // "HOBSIG64" #define GFW_HOB_START ((4UL<<30)-(14UL<<20)) // 4G - 14M @@ -568,6 +594,10 @@ setup_guest(int xc_handle, uint32_t dom, unsigned long memsize, goto error_out; } + xc_set_hvm_param(xc_handle, dom, + HVM_PARAM_STORE_PFN, STORE_PAGE_START>>PAGE_SHIFT); + xc_set_hvm_param(xc_handle, dom, HVM_PARAM_STORE_EVTCHN, store_evtchn); + *store_mfn = page_array[1]; sp = (shared_iopage_t *)xc_map_foreign_range(xc_handle, dom, PAGE_SIZE, PROT_READ|PROT_WRITE, page_array[0]); -- 2.30.2